package com.kwum.jsoup;

import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

/**
 * @Description: 
 * @Company: yimo
 * @author: Kwum
 * @date 2018年2月9日 上午11:05:00
 */

public class JsoupDemo {
	
	private static final String cookies = "sso_login_status=1; "
			+ "login_flag=0636828ff86706963e265d7b272a91aa; "
			+ "sessionid=618673f97d692048d25ddd9668e24314; "
			+ "sid_guard=\"618673f97d692048d25ddd9668e24314|1518054567|15552000|Tue\\054 07-Aug-2018 01:49:27 GMT\"; "
			+ "sid_tt=618673f97d692048d25ddd9668e24314; "
			+ "uid_tt=e10fac881d88ce6c8c997de259f24a67";

	public static void main(String[] args) throws IOException {
		Document document = Jsoup.connect("https://www.youtube.com/results?search_query=funny")
								.userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36")
								.header("Cookie", cookies)
								.ignoreContentType(true)
								.get();
		System.out.println(document.text());
	}
}
